package org.dbcopy.domain;

import java.io.File;
import java.io.Serializable;
import java.util.*;

public class Table {
	private String name;
	private List<List> tableData = new ArrayList<List>();
    private List<String> columns = new ArrayList<String>();

    public File getTableFile() {
        return tableFile;
    }

    public void setTableFile(File tableFile) {
        this.tableFile = tableFile;
    }

    private File tableFile;


    public void addColumn(String name){
        //System.out.println("Adding column " + name);
        columns.add(name);
    }

    public List<String> getColumns() {
        return columns;
    }

    public void addRow(Object data, int lineNumber) {
        List row;
        if (lineNumber < tableData.size()) {
            row = tableData.get(lineNumber);
        } else {
            row = new ArrayList();
            tableData.add(row);
        }
        row.add(data);
    }

    public Table(String name){
		this.name = name;
	}
	
	public String getName(){
		return name;
	}
	
	public List<List> getTableData() {
        return tableData;
    }
}